<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddRedundantColumnToCruiseShopAccountTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cruise_shop_account', function (Blueprint $table) {
            $table->unsignedInteger('provinceCode')->default(0)->comment('省Code');
            $table->unsignedInteger('cityCode')->default(0)->comment('市Code');
            $table->unsignedInteger('districtCode')->default(0)->comment('区Code');
            $table->string('franchiseeName')->default('')->comment('加盟商姓名');
            $table->string('shopName')->default('')->comment('门店名称');
            $table->string('shopCode')->default('')->comment('门店编号');
            $table->unsignedTinyInteger('businessStatus')->default(0)->comment('开业状态 0未开业 1已开业');
            $table->unsignedTinyInteger('orderRatioNumber')->default(0)->comment('订货占比 0-100');
            $table->unsignedInteger('daysWithoutCruise')->default(0)->comment('未巡检天数');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cruise_shop_account', function (Blueprint $table) {
            $table->dropColumn('provinceCode');
            $table->dropColumn('cityCode');
            $table->dropColumn('districtCode');
            $table->dropColumn('franchiseeName');
            $table->dropColumn('shopName');
            $table->dropColumn('shopCode');
            $table->dropColumn('businessStatus');
            $table->dropColumn('orderRatioNumber');
            $table->dropColumn('daysWithoutCruise');
        });
    }
}
